let vm = new Vue({
    el: "#ProductTable",
    data: {
        list: [],
        loading: false,
        finished: false,
        form: {
            page: 1,
            limit: 10
        },
        
        msgPopover: false,
        showMsg: false,
        message: "",
        radio: '通过',
        dataObj: {},
        processList: [],
    },
    methods: {
        getData() {
            leiku.post('http://dongtai.fsslpc.com/api/2020101979996275', this.form, res=> {
                let data = res.data;
                console.log(data)
                if (!data.a.length) {
                    this.finished = true
                }
                this.list.push.apply(this.list,data.a)
                this.loading = false
            })
        },
        // 滚到底部，触发load事件
        onLoad() {
            this.form.page++;
            this.getData();
        },

        msgPopoverBtn (rowId) {
            let id = rowId || leiku.GetUrlParam("touchanid")
            leiku.post('http://dongtai.fsslpc.com/api/2020091714821527', { touchanid: id }, res => {
                let data = res.data;
                console.log(data)
                if (data.length) {
                    this.dataObj = data[0]
                    this.msgPopover = true
                }
            })
        },
        // 弹出层按钮
        clickMsgBtn() {
            leiku.post('http://dongtai.fsslpc.com/api/2020091851517995', {touchanid: leiku.GetUrlParam("touchanid")}, res=> {
                let data = res.data;
                console.log(data)
                if (data.length) {
                    this.processList = data;
                }
            })
            this.showMsg = true;
        },
        // 保存按钮
        onSubmit() {
            leiku.post('http://dongtai.fsslpc.com/api/2020091840087881', {shenhe:this.radio, id: this.dataObj.id,idea: this.message,dt_dj1qko: window.localStorage.getItem('dt_dj1qko') ? JSON.parse(window.localStorage.getItem('dt_dj1qko')).str : ''}, res=> {
                this.$toast('保存成功')
                this.showMsg = false;
                window.location.reload();
            })
        },
    },
    mounted() {
        this.getData();
    }
})
